package com.dly.blog.service.impl;

import com.dly.blog.content.RedisContent;
import com.dly.blog.domain.config.ChatConfig;
import com.dly.blog.service.ChatConfigService;
import com.dly.blog.utile.RedisUtils;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class ChatConfigServiceImpl implements ChatConfigService {

    private final RedisUtils redisUtils;

    @Override
    public ChatConfig get() {
        return redisUtils.getCacheObject(RedisContent.CHAT_CONFIG);
    }

    @Override
    public void save(final ChatConfig config) {
        redisUtils.setCacheObject(RedisContent.CHAT_CONFIG, config);
    }
}
